package com.project.service.util;

import com.project.common.core.utils.SpringUtils;
import com.project.service.core.SystemConfigService;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * 系统配置工具
 *
 * @author wyy
 * @date 2019年08月15日
 */
@Component
public final class SettingUtils {
    /**
     * 不可实例化
     */
    private SettingUtils() {
    }

    /**
     * 获取系统设置
     *
     * @return 系统设置
     */
    public static Setting get() {
        Object sysConfigServiceObj = SpringUtils.getBean("systemConfigServiceImpl");
        Assert.notNull(sysConfigServiceObj, "sysConfigService为空");
        SystemConfigService sysConfigService = (SystemConfigService) sysConfigServiceObj;
        return sysConfigService.get();
    }
}
